<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--jQuery js-->
    <script src="../static/js/jquery.min.js" type="text/javascript"></script>
    <!--MiniUI-->
    <link href="../static/js/demo.css" rel="stylesheet" type="text/css" />
    <link href="../static/js/miniui/themes/default/miniui.css" rel="stylesheet" type="text/css" />
    <script src="../static/js/miniui/miniui.js" type="text/javascript"></script>
    <script src="../static/js/boot.js" type="text/javascript"></script>
    <script src="../static/js/ColumnsMenu.js" type="text/javascript"></script>
</head>
<body>
<form id="form1">
    <fieldset style="border:solid 1px #aaa;padding:3px;">
        <legend >基本信息</legend>
        <div style="padding:5px;">
            <table>
                <tr>
                    <input class="mini-hidden" name="id" visible="false" />
                    <td style="width:80px;">姓名:</td>
                    <td style="width:150px;">
                        <input  name="name" class="mini-textbox" required="true"/>
                    </td>
                    <td style="width:80px;">年龄:</td>
                    <td style="width:150px;">
                        <input  name="age" class="mini-textbox" required="true"/>
                    </td>
                </tr>
                <tr>
                    <td style="width:80px;">地址:</td>
                    <td style="width:150px;">
                        <input  name="address" class="mini-textbox" required="true"/>
                    </td>
                    <td style="width:80px;">生日:</td>
                    <td style="width:150px;">
                        <input  name="birthday" class="mini-datepicker" required="true"/>
                    </td>
                </tr>
            </table>
        </div>
    </fieldset>
    <div style="text-align:center;padding:10px;">
        <a class="mini-button" onclick="onOk" style="width:60px;margin-right:20px;">确定</a>
        <a class="mini-button" onclick="onCancel" style="width:60px;">取消</a>
    </div>
</form>


</body>
</html>
<script type="text/javascript">
    mini.parse();
    var form = new mini.Form("form1");

    function GetData() {
        var o = form.getData();
        return o;
    }

    function SetData(data){
        var fields = form.getFields();
        var c=fields[0];
        if(data.action="edit"){
            data=$.extend(true,data,data);
            if(c.setReadOnly){   //设置控件只读
                c.setReadOnly(true);
            }
            form.setData(data.edit_item);
        }
    }

    //关闭子页面
    function closeWindow(action) {
        if (window.CloseOwnerWindow){

            return window.CloseOwnerWindow(action,GetData);
        }else{
            window.close();
        }
    }

    function onOk() {
        closeWindow("ok");
    }

    function onCancel() {
        closeWindow("cancel");
    }
</script>